﻿using System;
using UnityEngine;

public class Paint
{
    public Color Color;
    public Font Typeface;

    public float TextSize { get; internal set; }

    internal void GetMaxCharacterBounds(string s, int v, int length, out Rect bounds)
    {
        bounds = new Rect();
        //throw new NotImplementedException();
    }

    internal void GetTextBounds(string text, int v, int length, Rect bounds)
    {
        //throw new NotImplementedException();
    }

    internal float MeasureText(string v)
    {
        if (v == FM_Const.TrebleClef || v == FM_Const.BassClef)
            return 40;
        if (v == FM_Const._2 || v == FM_Const._3 || v == FM_Const._4 || v == FM_Const._5 || v == FM_Const._6
            || v == FM_Const._7 || v == FM_Const._8 || v == FM_Const._9)
            return 20;
        return v.Length * 8;
        //throw new NotImplementedException();
    }

    internal void SetColor(Color color)
    {
        this.Color = color;
    }

    internal void SetTextSize(float v)
    {
        //Debug.LogError($"SetTextSize:{v}");
        TextSize = v;
    }

    internal void SetTypeface(Font _font)
    {
        this.Typeface = _font;
    }
}

